<!--#include virtual="/dzps/p1.asp"-->
<%
'设备类型'  
s1 "select title,cover_path,description,content from tzp where [ID]={id}"
%>
<!DOCTYPE html>
<html>
<head>
<%easp.include "h.asp"%>
<style>
.layui-upload-img{width: 92px; height: 92px; margin: 0 10px 10px 0;}
img
  {
  float:right;
  }
.layui-upload-list{float:right;margin:0 10px 10px 10px;}
</style>
</head>
<body>
  <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
<%
	Echo js2("input1.html","title","姓名",val("title"),"required")
	Echo js2("input1.html","cover_path","职称",val("cover_path"),"required")
	echo js2("textarea.html","description","简介",val("description"),"")
	i_h "id",val("id")
	i_h "content",val("content")
%>

<div class="layui-input-inline">
 <label class="layui-form-label">照片</label>      
  <div class="layui-upload-drag" id="test10">
		<i class="layui-icon"></i>
		<p>点击上传，或将文件拖拽到此处</p>
	</div>
  <div class="layui-upload-list">
    <img class="layui-upload-img" id="demo1" src="<%=val("content")%>">
    <p id="demoText"></p>
  </div>
</div>

    <div class="layui-form-item layui-hide">
      <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
  </div>
  <script src="/<%=rootpath%>/src/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/<%=rootpath%>/src/layuiadmin/' 
  }).extend({
    index: 'lib/index' 
  }).use(['index', 'set','form', 'upload','user'],function(){
    var $ = layui.$
    ,setter = layui.setter
    ,admin = layui.admin
    ,upload=layui.upload
    ,form = layui.form;  
	$("input:first").focus();

    upload.render({
    elem: '#test10'
    ,url: location.protocol+'//'+location.host+'/dzps/up1.asp?tn=<%=val("tn")%>&dbName=<%=val("dbName")%>&now=' + new Date().getTime()
    //,accept: 'file' //普通文件
    ,accept:'images'
    //,exts: 'zip|rar|7z|pdf|txt' //允许上传
    ,done: function(res){
      console.log(res);
      var path=location.protocol+'//'+location.host+'/dzps/upload/'+res.data.src;
      $("#demo1").attr('src',path); 
      $("#content").val(path);
      //alert(res.data.src);
	    layer.msg('上传成功！！'); 
    }
  });

  });
  </script>  
</body>
</html>